package com.zbkj.admin.controller.platform.assistant.service.impl;

import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.zbkj.admin.controller.platform.assistant.service.AssistantGroupAccountService;
import com.zbkj.common.model.assistant.AssistantGroupAccount;
import com.zbkj.common.page.CommonPage;
import com.zbkj.common.request.PageParamRequest;
import com.zbkj.service.assistant.model.request.AssistantGroupAccountSearchRequest;
import com.zbkj.service.assistant.model.vo.AssistantGroupAccountVO;
import com.zbkj.service.assistant.service.AssistantGroupAccountBaseServiceImpl;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Primary;
import org.springframework.stereotype.Service;

import java.util.List;

@Slf4j
@Primary
@Service
@RequiredArgsConstructor
public class AssistantGroupAccountServiceImpl extends AssistantGroupAccountBaseServiceImpl implements AssistantGroupAccountService {

    @Override
    public PageInfo<AssistantGroupAccountVO> getPage(AssistantGroupAccountSearchRequest request, PageParamRequest pageParamRequest) {
        Page<AssistantGroupAccountVO> page = PageHelper.startPage(pageParamRequest.getPage(), pageParamRequest.getLimit());
        List<AssistantGroupAccountVO> list = baseMapper.findList(request);
        return CommonPage.copyPageInfo(page, list);
    }
}

